package cn.edu.scau.cmi.yangminghao.composite;

import java.util.ArrayList;

import cn.edu.scau.cmi.yangminghao.client.interProgrammingClient2;

public class Organize2 implements Componet2{
	private String names;
	private ArrayList<Componet2> list= new ArrayList<Componet2>();
	
	public Organize2(String names) {
		super();
		this.names = names;
	}
	public Organize2() {
		
	}
	public void add(Componet2 s) {
		list.add( s);
	}
	public String getNames() {
		return names;
	}
	public void remove(Componet2 s) {
		list.remove(s);
	}
	
	public  void name(int v) {
		int u = v;
		String s1="--";
		while(v>0) {
			s1+="--";
			v--;
		}
		s1+="||";
		interProgrammingClient2.org+=s1+"组织 "+names+"\n" ;
		u++;
		
		for(Componet2 ss:list) {
			ss.name(u);
		}
	}
		
}
